package com.food.controller;


import com.food.configure.Result;
import com.food.entity.BillExportEntity;
import com.food.entity.SaleLog;
import com.food.entity.StatisticEntity;
import com.food.service.SaleLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author
 * @since 2021-04-04
 */
@RestController
@RequestMapping("/saleLog")
public class SaleLogController {

    @Autowired
    SaleLogService saleLogService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateSaleLog")
    public Result<SaleLog> updateSaleLog(@RequestBody SaleLog saleLog) {
        return saleLogService.updateSaleLog(saleLog);
    }

    /**
     * 删除
     */
    @RequestMapping("/delSaleLog")
    public Result<SaleLog> delSaleLog(@RequestBody SaleLog saleLog) {
        return saleLogService.delSaleLog(saleLog);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelSaleLog")
    public Result<SaleLog> batchDelSaleLog(@RequestBody SaleLog saleLog) {
        return saleLogService.batchDelSaleLog(saleLog);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/querySaleLog")
    public Result<SaleLog> querySaleLog(@RequestBody SaleLog saleLog) {
        return saleLogService.querySaleLog(saleLog);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/querySaleLogByPage")
    public Result<SaleLog> querySaleLogByPage(@RequestBody SaleLog saleLog) {
        return saleLogService.querySaleLogByPage(saleLog);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/querySaleLogById")
    public Result<SaleLog> querySaleLogById(@RequestBody SaleLog saleLog) {
        return saleLogService.querySaleLogById(saleLog);
    }

    /**
     * 账单导出--billExport.vue--查询
     */
    @RequestMapping("/billExport")
    public Result<BillExportEntity> billExport(@RequestBody BillExportEntity exportEntity) {
        return saleLogService.billExport(exportEntity);
    }

    /**
     * 账单导出
     */
    @RequestMapping("/materialStatistic")
    public Result<StatisticEntity> materialStatistic(@RequestBody StatisticEntity statisticEntity) {
        return saleLogService.materialStatistic(statisticEntity);
    }
}

